package com.test.utils;

public enum YesOrNo {

	NO(0, "否"),
    YES(1, "是");

    private Integer code;
    private String name;

    YesOrNo(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
    
    public static String getName(Integer code) {
    	YesOrNo[] values = YesOrNo.values();
    	for(YesOrNo yn : values) {
    		if(yn.getCode().equals(code)) {
    			return yn.getName();
    		}
    	}
    	return "";
    }
}
